# -*- coding=utf-8
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client
from qcloud_cos import CosServiceError
from qcloud_cos import CosClientError

import sys
import logging

secret_id = 'AKIDQjw36zQoz52pSvtSTK0ZyBE5lNrDLUN6'
secret_key = 'hIjz4yhFgxnX6bzDG8pOn14wd9Vk9NWU'
region = 'ap-chengdu'
new_Bucket = 'linux-1252095826'

def FileDeleteQcloud(filename):
    logging.basicConfig(level=logging.INFO, stream=sys.stdout)
    token = None
    config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token)
    client = CosS3Client(config)

    response = client.delete_object(
        Bucket=new_Bucket,
        Key=filename
   )
